﻿@using ABP.TPLMS.Web.Startup
@model ABP.TPLMS.Web.Models.Module.ModuleListViewModel

@{
    ViewData["Title"] = PageNames.Module;
}
@section scripts
    {
    <script src="~/view-resources/Views/Module/Index.js" asp-append-version="true"></script>
}


<div class="row clearfix">
    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
        <div class="card">
            <div class="header">
                <h2>
                    @L("Module")
                </h2>
                <ul class="header-dropdown m-r--5">
                    <li class="dropdown">
                        <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown"
                           role="button" aria-haspopup="true" aria-expanded="false">
                            <i class="material-icons">more_vert</i>
                        </a>
                        <ul class="dropdown-menu pull-right">

                            <li>
                                <a id="RefreshButton" href="javascript:void(0);"
                                   class="waves-effect waves-block"><i class="material-icons">refresh</i>@L("Refresh")</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="body table-responsive">

                <table class="table">
                    <thead>
                        <tr>
                            <th>
                                @Html.DisplayNameFor(model => model.Module.Name)

                            </th>

                            <th>

                                @Html.DisplayNameFor(model => model.Module.DisplayName)
                            </th>
                            <th>
                                @Html.DisplayNameFor(model => model.Module.HotKey)
                            </th>
                            <th>
                                @Html.DisplayNameFor(model => model.Module.IconName)
                            </th>
                            <th>
                                @Html.DisplayNameFor(model => model.Module.RequiredPermissionName)
                            </th>
                            <th>
                                @Html.DisplayNameFor(model => model.Module.Status)
                            </th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model.Modules)
                        {
                            <tr>
                                <td>
                                    @Html.DisplayFor(modelItem => item.Name)

                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.DisplayName)
                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.HotKey)
                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.IconName)
                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.RequiredPermissionName)
                                </td>
                                <td>
                                    @Html.DisplayFor(modelItem => item.Status)
                                </td>
                                <td class="dropdown">

                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                                       role="button" aria-haspopup="true" aria-expanded="false">
                                        <i class="material-icons">menu</i>
                                    </a>
                                    <ul class="dropdown-menu pull-right">
                                        <li>
                                            <a asp-action="Edit" class="waves-effect waves-block"
                                               asp-route-id="@item.Id"><i class="material-icons">edit</i>@L("Edit")</a>
                                        </li>
                                        <li>
                                            <a asp-action="Delete" class="waves-effect waves-block"
                                               asp-route-id="@item.Id"><i class="material-icons">delete_sweep</i>@L("Delete")</a>
                                        </li>
                                    </ul>

                                </td>
                            </tr>
                        }

                    </tbody>

                </table>

                <a asp-action="Create"
                   class="btn btn-primary btn-circle waves-effect waves-circle waves-float pull-right">
                    <i class="material-icons">add</i>
                </a>
            </div>
        </div>
    </div>
</div>